<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

use Illuminate\Support\Facades\DB;

class AddCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'add';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '增加数据';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        for ($k=1;$k<=5000000;$k++){
            DB::table('test1')->insert([
                'title_id'=>$k+1,
                'user_id'=>$k+2,
                'title'=>'标题'.$k,
                'content'=>'内容'.$k,
                'intro'=>'介绍'.$k,
                'keyword'=>'关键词'.$k,
            ]);
        }

    }
}
